use dataset_zipcode, clear

gen anyfracking = D > 0
gen in_shale_play = !mi(Shale_play)

gen z = 0 if anyfracking == 0 & in_shale_play == 0
replace z = 0 if anyfracking == 1 & in_shale_play == 0
replace z = 1 if in_shale_play == 1 & anyfracking == 0
replace z = 2 if in_shale_play == 1 & anyfracking == 1

tab anyfracking in_shale_play, col

#delimit;

spmap 
	z
		using dataset_coords_zipcode
		,
			fcol(Greys2)
			clmethod(unique)
			id(_ID)
			ndsize(none)
			ocol(white white white white white)
			osize(none none none none none)
			polygon(data(dataset_state_outlines))
			legend(
				order(
					3 "In Shale Play"
					4 "Ever Fracked"
				)
				size(huge)
				symysize(medium)
				symxsize(medium)
				rowgap(0)
				pos(7)
			)	
			;
			
#delimit cr

gr export "_output/figureA4.png", replace

